<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改调动申请')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-jobTransfer-edit" th:object="${hrJobTransfer}">
            <input name="jobTransferId" th:field="*{jobTransferId}" type="hidden">
            <input name="instanceId" th:field="*{instanceId}" type="hidden">
            <div class="form-group"  style="display: none">
                <label class="col-sm-3 control-label is-required">调动人id：</label>
                <div class="col-sm-8">
                    <input name="empId" th:field="*{empId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">调动人姓名：</label>
                <div class="col-sm-8">
                    <input name="empName" th:field="*{empName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">入职日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="nonManagerDate" th:value="${#dates.format(hrJobTransfer.nonManagerDate, 'yyyy-MM-dd')}" class="form-control" readonly="readonly" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">现岗位id：</label>
                <div class="col-sm-8">
                    <!--<input name="currentPostId" th:field="*{currentPostId}" class="form-control" type="text" required>-->
                    <select id="currentPostId" name="currentPostId" class="form-control m-b" th:with="postAll=${@postService.getPostAll()}" required>
                        <option value="">请选择</option>
                        <option th:each="post : ${postAll}" th:text="${post.getPostName()}" th:value="${post.getPostId()}"  th:hidden="${post.getStatus() == '1'}" th:field="*{currentPostId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">现部门id：</label>
                <div class="col-sm-8">
                    <!--<input name="currentDeptId" th:field="*{currentDeptId}" class="form-control" type="text" required>-->
                    <select id="currentDeptId" name="currentDeptId" class="form-control m-b" th:with="deptAll=${@deptService.getDeptAll()}">
                        <option value="">请选择</option>
                        <option th:each="dept : ${deptAll}" th:text="${dept.getShowName()}" th:value="${dept.getDeptId()}" th:field="*{currentDeptId}"
                                th:hidden="${dept.getStatus() == '1' || dept.getDelFlag() != '0' }"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">调动岗位id：</label>
                <div class="col-sm-8">
                    <!--<input name="jobTransferPostId" th:field="*{jobTransferPostId}" class="form-control" type="text" required>-->
                    <select id="jobTransferPostId" name="jobTransferPostId" class="form-control m-b" th:with="postAll=${@postService.getPostAll()}" required>
                        <option value="">请选择</option>
                        <option th:each="post : ${postAll}" th:text="${post.getPostName()}" th:value="${post.getPostId()}"  th:hidden="${post.getStatus() == '1'}" th:field="*{jobTransferPostId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">调动部门id：</label>
                <div class="col-sm-8">
                    <!--<input name="jobTransferDeptId" th:field="*{jobTransferDeptId}" class="form-control" type="text" required>-->
                    <select id="jobTransferDeptId" name="jobTransferDeptId" class="form-control m-b" th:with="deptAll=${@deptService.getDeptAll()}">
                        <option value="">请选择</option>
                        <option th:each="dept : ${deptAll}" th:text="${dept.getShowName()}" th:value="${dept.getDeptId()}" th:field="*{jobTransferDeptId}"
                                th:hidden="${dept.getStatus() == '1' || dept.getDelFlag() != '0' }"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">调动日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="jobTransferrDate" th:value="${#dates.format(hrJobTransfer.jobTransferrDate, 'yyyy-MM-dd')}" class="form-control" readonly="readonly" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">调动原因：</label>
                <div class="col-sm-8">
                    <input name="jobTransferDescription" th:field="*{jobTransferDescription}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">调动类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_job_transfer')}">
                        <input type="radio" th:id="${'jobTransferType_' + dict.dictCode}" name="jobTransferType" th:value="${dict.dictValue}" th:field="*{jobTransferType}" required>
                        <label th:for="${'jobTransferType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div th:replace="include/fileUploadUtil::fileUploadShow(${hrJobTransfer},'附件')" ></div>

           <!-- <div class="form-group" >
                <label class="col-sm-3 control-label is-required">现领导意见：</label>
                <div class="col-sm-8">
                    <input name="currentDescription" th:field="*{currentDescription}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">调动领导意见：</label>
                <div class="col-sm-8">
                    <input name="transferDescription" th:field="*{transferDescription}" class="form-control" type="text" required>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "hr/jobTransfer";
        $("#form-jobTransfer-edit").validate({
            focusCleanup: true
        });
        for (var i = 0; i < document.getElementsByTagName("input").length; i++) {
            document.getElementsByTagName("input")[i].disabled = true;
        }
        for (var i = 0; i < document.getElementsByTagName("textarea").length; i++) {
            document.getElementsByTagName("textarea")[i].disabled = true;
        }
        for (var i = 0; i < document.getElementsByTagName("select").length; i++) {
            document.getElementsByTagName("select")[i].disabled = true;
        }
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-jobTransfer-edit').serialize());
            }
        }

        $("input[name='nonManagerDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>